A PLC includes a plurality of units, such as a CPU (Central Processing Unit) unit including a microprocessor which executes a control program, an IO (Input Output) unit, which receives a signal from an external switch or sensor and outputs a signal to an external relay or actuator, or the like. The CPU unit controls an object of control by repeating transmission of output data to other units, reception of input data from other units, and execution of a control program for producing the output data using the input data. The control program includes a user program which is produced based on a user's purpose of control. The control program may include a motion operation program. The user program instructs the CPU unit to execute the motion operation program.
As described in Patent Document 1 (JP 2000-105604 A), in conventional PLCs, one sequence program (control program) and one set of output refresh and input refresh are executed in each control cycle. In this case, the control cycle is equal to the execution cycle of the control program.
In PLCs, it is known that a plurality of control programs may be executed in a time-division manner.
Patent Document 2 (JP 2007-140655 A) describes a device in which a motion control function of controlling a motor and a PLC function of executing a sequence operation are processed by a single CPU. In the device, “a fixed-cycle motion control process and each axial process” and “a high-speed sequence process” are executed in each cycle of a basic clock, and “a low-speed sequence process” or “a non-fixed-cycle motion control process” is executed in the remainder of each basic clock cycle. Patent Document 2 also describes that when the low-speed sequence process is not completed within a basic clock cycle, the remainder of the process is executed after being suspended for a period of time corresponding to a predetermined number of basic clocks (e.g., paragraph 0004).
Patent Document 3 (JP 2000-293210 A) describes, relating to an operation of a control device, that a plurality of refresh blocks for performing an input process and a plurality of refresh blocks for performing an output process are provided in addition to periodic tasks (control program), and some of the refresh blocks and some of the periodic tasks are selectively executed in each control cycle.